package mylib.archive.y2012.m08.SNSS_R3;

import mylib.dir.FastInputReader;
import mylib.dir.InputUtils;
import mylib.dir.SimpleUtils;

import java.io.PrintWriter;

public class taskC {
    public void solve(int testNumber, FastInputReader in, PrintWriter out) {
        String s = in.nextString();
        int n = s.length();
        int[] b = new int[2 * n - 1];
        InputUtils.inputArray(in, b);
        int[] a = new int[n];
        for (int i = 0; i < n; ++i) {
            a[i] = s.charAt(i) - 'A';
        }
        int two = 1;
        while (two < 2 * n - 1)
            two *= 2;
        int[] _b = new int[two];
        int[] _a = new int[two];
        System.arraycopy(b, 0, _b, 0, b.length);
        System.arraycopy(a, 0, _a, 0, a.length);
        a = _a;
        b = _b;
        SimpleUtils.fft(a, false);
        SimpleUtils.fft(b, false);
        for (int i = 0; i < a.length; ++i) {
            a[i] = (int) ((long) a[i] * b[i] % SimpleUtils.fftMod);
        }
        SimpleUtils.fft(a, true);
        for (int i = n - 1; i < 2 * n - 1; ++i) {
            out.print((char) (a[i] % 26 + 'A'));
        }
    }
}
